#pragma once

#include "StlWrapper.h"

class GameControls;
class ServiceProvider;
class Menu;

class MenuManager
{
public:
	typedef STL::vector<Menu*> MenuStack;

	MenuManager(ServiceProvider* i_sp, GameControls* i_gc);
	~MenuManager();

	void PushMenu(Menu* i_menu);
	void PopMenu();
	void SetMenu(Menu* i_menu);
	void Run();

	Menu* GetStartingMenu(){return m_startingMenu;}
	Menu* GetTeamSelectionMenu(){return m_teamSelectionMenu;}
	Menu* GetMainMenu(){return m_mainMenu;}
	Menu* GetTeamsManagementMenu(){return m_teamsManagementMenu;}
	Menu* GetClassificationMenu(){return m_classificationMenu;}
	Menu* GetTurnsMenu(){return m_turnsMenu;}
	Menu* GetTeamsStatsMenu(){return m_teamsStatsMenu;}
	Menu* GetLeagueStatsMenu(){return m_leagueStatsMenu;}
	Menu* GetLeagueSelectionMenu(){return m_leagueSelectionMenu;}
	Menu* GetLeagueMenu(){return m_leagueMenu;}
	Menu* GetLeagueHistoryMenu(){return m_leagueHistoryMenu;}
	Menu* GetPlayersStatsMenu(){return m_playersStatsMenu;}
	Menu* GetPlayersStatsShowMenu(){return m_playersStatsShowMenu;}
	Menu* GetViewTeamsFormationMenu(){return m_viewTeamsFormationMenu;}
	Menu* GetPlayTurnsMenu(){return m_playTurnsMenu;}
	Menu* GetLoadMenu(){return m_loadMenu;}
	Menu* GetSaveMenu(){return m_saveMenu;}
	Menu* GetEndLeagueMenu(){return m_endLeagueMenu;}
	Menu* GetGameOverMenu(){return m_gameOverMenu;}
	Menu* GetPlayerMenu(){return m_playerMenu;}
	Menu* GetHistoryPlayerMenu(){return m_historyPlayerMenu;}
	Menu* GetTeamMenu(){return m_teamMenu;}
	Menu* GetTeamMatchesMenu(){return m_teamMatchesMenu;}
	Menu* GetTeamHistoryMenu(){return m_teamHistoryMenu;}
	Menu* GetMatchMenu(){return m_matchMenu;}
	Menu* GetSearchMenu(){return m_searchMenu;}
	Menu* GetUserSelectionMenu(){return m_userSelectionMenu;}
	Menu* GetOfferTeamMenu(){return m_offerTeamMenu;}
	Menu* GetOfferPlayerMenu(){return m_offerPlayerMenu;}
	Menu* GetShortListNotificationMenu(){return m_shortListNotificationMenu;}
	Menu* GetShortListMenu(){return m_shortListMenu;}

	Menu* GetConfirmPanel(){return m_confirmPanel;}
	Menu* GetNotificationPanel(){return m_notificationPanel;}

	GameControls* GetGameControls() { return m_gc; }
	ServiceProvider* GetServiceProvider() { return m_sp; }

private:
	void SetupEnv();
	
	GameControls* m_gc;
	ServiceProvider* m_sp;

	Menu* m_currentMenu;
	MenuStack m_menuStack;
	
	Menu* m_startingMenu;
	Menu* m_teamSelectionMenu;
	Menu* m_mainMenu;
	Menu* m_teamsManagementMenu;
	Menu* m_classificationMenu;
	Menu* m_playersStatsMenu;
	Menu* m_playersStatsShowMenu;
	Menu* m_turnsMenu;
	Menu* m_teamsStatsMenu;
	Menu* m_leagueStatsMenu;
	Menu* m_leagueMenu;
	Menu* m_leagueSelectionMenu;
	Menu* m_leagueHistoryMenu;
	Menu* m_viewTeamsFormationMenu;
	Menu* m_playTurnsMenu;
	Menu* m_loadMenu;
	Menu* m_saveMenu;
	Menu* m_endLeagueMenu;
	Menu* m_gameOverMenu;
	Menu* m_playerMenu;
	Menu* m_historyPlayerMenu;
	Menu* m_scoredGoalsPlayerMenu;
	Menu* m_teamMenu;
	Menu* m_teamMatchesMenu;
	Menu* m_teamHistoryMenu;
	Menu* m_matchMenu;
	Menu* m_searchMenu;
	Menu* m_userSelectionMenu;
	Menu* m_offerTeamMenu;
	Menu* m_offerPlayerMenu;
	Menu* m_shortListNotificationMenu;
	Menu* m_shortListMenu;

	Menu* m_confirmPanel;
	Menu* m_notificationPanel;
};
